/*
 * Session.java
 */

package xq.runner;

import java.util.prefs.Preferences;

/**
 *
 * @author ThorntonRP
 */
public class Session implements xq.session.Session {

	public static final String CONNECTION_URI_KEY    = "connectionURI";
	public static final String RESOURCE_PATH_KEY     = "resourcePath";
	public static final String QUERY_RESOURCE_KEY    = "queryResource";
	public static final String CURRENT_DIRECTORY_KEY = "currentDirectory";
	public static final String QUERY_VARIABLES_KEY   = "queryVariables";

	private final Preferences prefs;

	public Session() {
		prefs = Preferences.userNodeForPackage(getClass());
	}

	@Override
	public String get(String key) {
		return prefs.get(key, null);
	}

	@Override
	public String get(String key, String def) {
		return prefs.get(key, def);
	}

	@Override
	public void put(String key, String value) {
		prefs.put(key, value);
	}

	@Override
	public void remove(String key) {
		prefs.remove(key);
	}
}
